package org.example.hotel.controller;

import org.example.hotel.dto.BillingDTO;
import org.example.hotel.dto.BillingDetailDTO;
import org.example.hotel.service.BillingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/room")
public class BillingController {

    @Autowired
    private BillingService billingService;

    @PostMapping("/{roomId}/checkout")
    public BillingDTO checkOut(@PathVariable int roomId) {
        return billingService.checkOut(roomId);
    }

    @GetMapping("/{roomId}/billing")
    public BillingDTO getBilling(@PathVariable int roomId) {
        return billingService.getBilling(roomId);
    }

    @GetMapping("/{roomId}/billing/detail")
    public BillingDetailDTO getBillingDetail(@PathVariable int roomId) {
        return billingService.getBillingDetail(roomId);
    }
}
